import React from 'react';
import { Modal } from 'antd';

const MessageModal = (type: any, title: any, content: string | React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined) => {
  switch (type) {
    case 'success':
      return Modal.success({
        content: <p>{content}</p>,
      });
    case 'error':
      return Modal.error({
        title: title,
        content: <p>{content}</p>,
      });
    case 'warning':
      return Modal.warning({
        title: title,
        content: <p>{content}</p>,
      });
    default: return null
  }
}

export { MessageModal };